<?php
	class signin extends spController
	{
		function __construct()
		{
				// 必须加入启动父类构造函数的操作
				parent::__construct();
				 
				// 开始全局操作
				$this->arr_cat = Product_Cat();
				$this->a = $_GET['a'];
				$this->c = $_GET['c'];
		}

		function signin()
		{
			if(!$_SESSION['visitor_id']) return false;
			$m_sign = spClass("m_signin");
			if(!$m_sign->find(array('visitor_id'=>$_SESSION['visitor_id'], 'sign_date'=>date('Y-m-d', time())))) {
				$m_sign->create(array('visitor_id'=>$_SESSION['visitor_id'], 'sign_date'=>date('Y-m-d', time())));
			}
			return false;
		}

		function lottery()
		{
			$m_sign = spClass("m_signin");
			if(!$_SESSION['visitor_id']) return false;
			if($m_sign->checkthreeday($_SESSION['visitor_id'])) {
				//随机产生数字，并为给用户增加，插入lottery表
			}
		}

		function index()
		{
			$this->display("sign_index.html");
		}
	}
?>